#%RAML 1.0

title: BookInStorage API
baseUri: https://github.com/folio-lufam/mod-bookInStorages
version: v1

documentation:
  - title: mod-bookInStorages API
    content: This documents the API calls that can be made to post bookInStorages that can be attached to various objects

types:
  bookInStorage: !include bookInStorage.json
  bookInStoragesCollection: !include bookInStoragesCollection.json
  errors: !include raml-util/schemas/errors.schema

traits:
  validate: !include raml-util/traits/validation.raml
  language: !include raml-util/traits/language.raml
  pageable:  !include raml-util/traits/pageable.raml
  searchable: !include raml-util/traits/searchable.raml

resourceTypes:
  collection: !include raml-util/rtypes/collection.raml
  collection-item: !include raml-util/rtypes/item-collection.raml
  update-status: !include rtypes/book-in-storage-update-status.raml

/bookInStorages:
  displayName: BookInStorages
  description: BookInStorages that can be attached to various objects
  type:
    collection:
      schemaCollection: bookInStoragesCollection
      schemaItem: bookInStorage
      exampleCollection: !include examples/bookInStoragesCollection.sample
      exampleItem: !iokInStoragenclude examples/bo.sample

  post:
    is: [validate]
  get:
    is: [
      searchable: {description: "with valid searchable fields: for example label=foo", example: "label=foo"},
      pageable,
      validate
    ]
  /{id}:
    uriParameters:
      id:
        pattern : "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    displayName: bookInStorage
    description: Get, Delete or Update a specific bookInStorage
    type:
      collection-item:
        schema: bookInStorage
        exampleItem: !include examples/bookInStorage.sample
    put:
      is: [validate]
  /submit/{id}:
    uriParameters:
      id:
        pattern : "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    description: submit a specific bookInStorage
    type:
      update-status:
        schema: bookInStorage
        exampleItem: !include examples/bookInStorage.sample
  /unSubmit/{id}:
    uriParameters:
      id:
        pattern : "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    description: unSubmit a specific bookInStorage
    type:
      update-status:
        schema: bookInStorage
        exampleItem: !include examples/bookInStorage.sample
  /review/{id}:
    uriParameters:
      id:
        pattern : "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    description: review a specific bookInStorage
    type:
      update-status:
        schema: bookInStorage
        exampleItem: !include examples/bookInStorage.sample
  /sign/{id}:
    uriParameters:
      id:
        pattern : "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    description: sign a specific bookInStorage
    type:
      update-status:
        schema: bookInStorage
        exampleItem: !include examples/bookInStorage.sample
  /confirm/{id}:
    uriParameters:
      id:
        pattern : "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    description: confirm a specific bookInStorage
    type:
      update-status:
        schema: bookInStorage
        exampleItem: !include examples/bookInStorage.sample
